MyUserPaneFocusProc
NEW WITH THE APPEARANCE MANAGER
Handles keyboard focus.The Control Manager declares the type for an application-defined user pane focus function as follows:
typedef pascal ControlPartCode (*ControlUserPaneFocusProc)( ControlHandle control, ControlFocusPart action);The Control Manager defines the data typeControlUserPaneFocusUPP
to identify the universal procedure pointer for this application-defined function:
typedef UniversalProcPtr ControlUserPaneFocusUPP;You typically use theNewControlUserPaneFocusProc
macro like this:
ControlUserPaneFocusUPP myControlUserPaneFocusUPP; myControlUserPaneFocusUPP = NewControlUserPaneFocusProc (MyUsePaneFocus);You typically use theCallControlUserPaneFocusProc
macro like this:
CallControlUserPaneFocusProc(myControlUserPaneFocusUPP, control, action);Here's how to declare the functionMyUserPaneFocusProc:
pascal ControlPartCode MyUserPaneFocusProc ( ControlHandle control ControlFocusPart action);
control
- A handle to the control that is to adjust its focus.
action
- The part code of the user pane to receive keyboard focus; see "Handling Keyboard Focus".
- function result
- Returns the part of the user pane actually focused.
kControlFocusNoPart
is returned if the user pane has lost the focus or cannot be focused.DISCUSSION
YourMyUserPaneFocusProc
function is called in response to a change in keyboard focus. It should respond by changing keyboard focus based on the part code passed in theaction
parameter.This function will only get called if you've set the
kControlSupportsFocus
feature bit on creation of the user pane control. Once you have created the functionMyUserPaneFocusProc
, passkControlUserPaneFocusProcTag
in thetagName
parameter ofSetControlData
.